/**
 *添加设备
 */
'use strict';

const conn = require('../../libs/DB/Conn');
const operationRecord = require("../sys/operationRecordAction");

module.exports = async function (params) {
    let enableObj = {
        enable : parseInt(params.enable) > 1 ? 2 : 1
    }
    await conn("UPDATE device_file SET ? WHERE device_id = ?",[enableObj,params.deviceId])
    await operationRecord(params);
    return { success: true };
};
